// Copyright (c) 2009 Luca Marrocco.
// Modified or written by Luca Marrocco for inclusion with codej.
// Licensed under the Apache License, Version 2.0 (the "License")
package codej.source;

import codej.ast.*;

/** @author Luca Marrocco */
public class Languages {

	private interface CompileDelegate {
		Node compile();
	}

	public static final Node compile(CompileDelegate compileDelegate) {
		return compileDelegate.compile();
	}

	public static final Node compileJava(String source) {
		return compile(java(source));
	}

	public static final CompileDelegate java(final String source) {
		return new CompileDelegate() {
			public Node compile() {
				return new JavaLanguage(source).compile();
			}
		};
	}
}
